(function(x,J){typeof exports=="object"&&typeof module<"u"?J(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],J):(x=typeof globalThis<"u"?globalThis:x||self,J(x["ipc-grid-toolbox"]={},x.react))})(this,function(x,J){"use strict";const Xe=n=>n&&typeof n=="object"&&"default"in n?n:{default:n};function qe(n){if(n&&n.__esModule)return n;const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const p in n)if(p!=="default"){const v=Object.getOwnPropertyDescriptor(n,p);Object.defineProperty(f,p,v.get?v:{enumerable:!0,get:()=>n[p]})}}return f.default=n,Object.freeze(f)}const Q=Xe(J),ee=qe(J);var _=function(){return _=Object.assign||function(f){for(var p,v=1,M=arguments.length;v<M;v++){p=arguments[v];for(var P in p)Object.prototype.hasOwnProperty.call(p,P)&&(f[P]=p[P])}return f},_.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;var fe={exports:{}},re={};/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Ee;function Je(){if(Ee)return re;Ee=1;var n=Q.default,f=Symbol.for("react.element"),p=Symbol.for("react.fragment"),v=Object.prototype.hasOwnProperty,M=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,P={key:!0,ref:!0,__self:!0,__source:!0};function Y(j,b,L){var y,T={},s=null,A=null;L!==void 0&&(s=""+L),b.key!==void 0&&(s=""+b.key),b.ref!==void 0&&(A=b.ref);for(y in b)v.call(b,y)&&!P.hasOwnProperty(y)&&(T[y]=b[y]);if(j&&j.defaultProps)for(y in b=j.defaultProps,b)T[y]===void 0&&(T[y]=b[y]);return{$$typeof:f,type:j,key:s,ref:A,props:T,_owner:M.current}}return re.Fragment=p,re.jsx=Y,re.jsxs=Y,re}var te={};/**
 * @license React
 * react-jsx-runtime.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Re;function He(){return Re||(Re=1,process.env.NODE_ENV!=="production"&&function(){var n=Q.default,f=Symbol.for("react.element"),p=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),Y=Symbol.for("react.provider"),j=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),s=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),U=Symbol.iterator,B="@@iterator";function z(e){if(e===null||typeof e!="object")return null;var r=U&&e[U]||e[B];return typeof r=="function"?r:null}var W=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function d(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];$("error",e,t)}}function $(e,r,t){{var o=W.ReactDebugCurrentFrame,l=o.getStackAddendum();l!==""&&(r+="%s",t=t.concat([l]));var u=t.map(function(a){return String(a)});u.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,u)}}var V=!1,S=!1,I=!1,E=!1,D=!1,c;c=Symbol.for("react.module.reference");function R(e){return!!(typeof e=="string"||typeof e=="function"||e===v||e===P||D||e===M||e===L||e===y||E||e===A||V||S||I||typeof e=="object"&&e!==null&&(e.$$typeof===s||e.$$typeof===T||e.$$typeof===Y||e.$$typeof===j||e.$$typeof===b||e.$$typeof===c||e.getModuleId!==void 0))}function G(e,r,t){var o=e.displayName;if(o)return o;var l=r.displayName||r.name||"";return l!==""?t+"("+l+")":t}function C(e){return e.displayName||"Context"}function k(e){if(e==null)return null;if(typeof e.tag=="number"&&d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case p:return"Portal";case P:return"Profiler";case M:return"StrictMode";case L:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case j:var r=e;return C(r)+".Consumer";case Y:var t=e;return C(t._context)+".Provider";case b:return G(e,e.render,"ForwardRef");case T:var o=e.displayName||null;return o!==null?o:k(e.type)||"Memo";case s:{var l=e,u=l._payload,a=l._init;try{return k(a(u))}catch{return null}}}return null}var X=Object.assign,ne=0,we,Te,Se,ke,Oe,Pe,je;function De(){}De.__reactDisabledLog=!0;function rr(){{if(ne===0){we=console.log,Te=console.info,Se=console.warn,ke=console.error,Oe=console.group,Pe=console.groupCollapsed,je=console.groupEnd;var e={configurable:!0,enumerable:!0,value:De,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ne++}}function tr(){{if(ne--,ne===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:X({},e,{value:we}),info:X({},e,{value:Te}),warn:X({},e,{value:Se}),error:X({},e,{value:ke}),group:X({},e,{value:Oe}),groupCollapsed:X({},e,{value:Pe}),groupEnd:X({},e,{value:je})})}ne<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var pe=W.ReactCurrentDispatcher,ve;function le(e,r,t){{if(ve===void 0)try{throw Error()}catch(l){var o=l.stack.trim().match(/\n( *(at )?)/);ve=o&&o[1]||""}return`
`+ve+e}}var he=!1,ue;{var nr=typeof WeakMap=="function"?WeakMap:Map;ue=new nr}function Le(e,r){if(!e||he)return"";{var t=ue.get(e);if(t!==void 0)return t}var o;he=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var u;u=pe.current,pe.current=null,rr();try{if(r){var a=function(){throw Error()};if(Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(O){o=O}Reflect.construct(e,[],a)}else{try{a.call()}catch(O){o=O}e.call(a.prototype)}}else{try{throw Error()}catch(O){o=O}e()}}catch(O){if(O&&o&&typeof O.stack=="string"){for(var i=O.stack.split(`
`),w=o.stack.split(`
`),h=i.length-1,m=w.length-1;h>=1&&m>=0&&i[h]!==w[m];)m--;for(;h>=1&&m>=0;h--,m--)if(i[h]!==w[m]){if(h!==1||m!==1)do if(h--,m--,m<0||i[h]!==w[m]){var F=`
`+i[h].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&ue.set(e,F),F}while(h>=1&&m>=0);break}}}finally{he=!1,pe.current=u,tr(),Error.prepareStackTrace=l}var Z=e?e.displayName||e.name:"",q=Z?le(Z):"";return typeof e=="function"&&ue.set(e,q),q}function or(e,r,t){return Le(e,!1)}function ir(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function se(e,r,t){if(e==null)return"";if(typeof e=="function")return Le(e,ir(e));if(typeof e=="string")return le(e);switch(e){case L:return le("Suspense");case y:return le("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case b:return or(e.render);case T:return se(e.type,r,t);case s:{var o=e,l=o._payload,u=o._init;try{return se(u(l),r,t)}catch{}}}return""}var oe=Object.prototype.hasOwnProperty,Ae={},Fe=W.ReactDebugCurrentFrame;function ce(e){if(e){var r=e._owner,t=se(e.type,e._source,r?r.type:null);Fe.setExtraStackFrame(t)}else Fe.setExtraStackFrame(null)}function ar(e,r,t,o,l){{var u=Function.call.bind(oe);for(var a in e)if(u(e,a)){var i=void 0;try{if(typeof e[a]!="function"){var w=Error((o||"React class")+": "+t+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw w.name="Invariant Violation",w}i=e[a](r,a,o,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(h){i=h}i&&!(i instanceof Error)&&(ce(l),d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",t,a,typeof i),ce(null)),i instanceof Error&&!(i.message in Ae)&&(Ae[i.message]=!0,ce(l),d("Failed %s type: %s",t,i.message),ce(null))}}}var lr=Array.isArray;function ge(e){return lr(e)}function ur(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function sr(e){try{return Me(e),!1}catch{return!0}}function Me(e){return""+e}function Ne(e){if(sr(e))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ur(e)),Me(e)}var ie=W.ReactCurrentOwner,cr={key:!0,ref:!0,__self:!0,__source:!0},Ye,We,be;be={};function fr(e){if(oe.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function dr(e){if(oe.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function pr(e,r){if(typeof e.ref=="string"&&ie.current&&r&&ie.current.stateNode!==r){var t=k(ie.current.type);be[t]||(d('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k(ie.current.type),e.ref),be[t]=!0)}}function vr(e,r){{var t=function(){Ye||(Ye=!0,d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function hr(e,r){{var t=function(){We||(We=!0,d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var gr=function(e,r,t,o,l,u,a){var i={$$typeof:f,type:e,key:r,ref:t,props:a,_owner:u};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function br(e,r,t,o,l){{var u,a={},i=null,w=null;t!==void 0&&(Ne(t),i=""+t),dr(r)&&(Ne(r.key),i=""+r.key),fr(r)&&(w=r.ref,pr(r,l));for(u in r)oe.call(r,u)&&!cr.hasOwnProperty(u)&&(a[u]=r[u]);if(e&&e.defaultProps){var h=e.defaultProps;for(u in h)a[u]===void 0&&(a[u]=h[u])}if(i||w){var m=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&vr(a,m),w&&hr(a,m)}return gr(e,i,w,l,o,ie.current,a)}}var me=W.ReactCurrentOwner,Ie=W.ReactDebugCurrentFrame;function K(e){if(e){var r=e._owner,t=se(e.type,e._source,r?r.type:null);Ie.setExtraStackFrame(t)}else Ie.setExtraStackFrame(null)}var ye;ye=!1;function xe(e){return typeof e=="object"&&e!==null&&e.$$typeof===f}function Ue(){{if(me.current){var e=k(me.current.type);if(e)return`

Check the render method of \``+e+"`."}return""}}function mr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`

Check your code at `+r+":"+t+"."}return""}}var ze={};function yr(e){{var r=Ue();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`

Check the top-level render call using <`+t+">.")}return r}}function $e(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=yr(r);if(ze[t])return;ze[t]=!0;var o="";e&&e._owner&&e._owner!==me.current&&(o=" It was passed a child from "+k(e._owner.type)+"."),K(e),d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,o),K(null)}}function Ve(e,r){{if(typeof e!="object")return;if(ge(e))for(var t=0;t<e.length;t++){var o=e[t];xe(o)&&$e(o,r)}else if(xe(e))e._store&&(e._store.validated=!0);else if(e){var l=z(e);if(typeof l=="function"&&l!==e.entries)for(var u=l.call(e),a;!(a=u.next()).done;)xe(a.value)&&$e(a.value,r)}}}function xr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===b||r.$$typeof===T))t=r.propTypes;else return;if(t){var o=k(r);ar(t,e.props,"prop",o,e)}else if(r.PropTypes!==void 0&&!ye){ye=!0;var l=k(r);d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",l||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _r(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var o=r[t];if(o!=="children"&&o!=="key"){K(e),d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),K(null);break}}e.ref!==null&&(K(e),d("Invalid attribute `ref` supplied to `React.Fragment`."),K(null))}}var Be={};function Ge(e,r,t,o,l,u){{var a=R(e);if(!a){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var w=mr(l);w?i+=w:i+=Ue();var h;e===null?h="null":ge(e)?h="array":e!==void 0&&e.$$typeof===f?(h="<"+(k(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):h=typeof e,d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",h,i)}var m=br(e,r,t,l,u);if(m==null)return m;if(a){var F=r.children;if(F!==void 0)if(o)if(ge(F)){for(var Z=0;Z<F.length;Z++)Ve(F[Z],e);Object.freeze&&Object.freeze(F)}else d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ve(F,e)}if(oe.call(r,"key")){var q=k(e),O=Object.keys(r).filter(function(Sr){return Sr!=="key"}),_e=O.length>0?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}";if(!Be[q+_e]){var Tr=O.length>0?"{"+O.join(": ..., ")+": ...}":"{}";d(`A props object containing a "key" prop is being spread into JSX:
  let props = %s;
  <%s {...props} />
React keys must be passed directly to JSX without using spread:
  let props = %s;
  <%s key={someKey} {...props} />`,_e,q,Tr,q),Be[q+_e]=!0}}return e===v?_r(m):xr(m),m}}function Er(e,r,t){return Ge(e,r,t,!0)}function Rr(e,r,t){return Ge(e,r,t,!1)}var Cr=Rr,wr=Er;te.Fragment=v,te.jsx=Cr,te.jsxs=wr}()),te}(function(n){process.env.NODE_ENV==="production"?n.exports=Je():n.exports=He()})(fe);const g=fe.exports.jsx,de=fe.exports.jsxs;var Ce="white",Ke=0,Ze=!1;x.LayoutEnum=void 0,function(n){n[n.OneColumn=1]="OneColumn",n[n.FourColumns=4]="FourColumns",n[n.NineColumns=9]="NineColumns",n[n.ThirteenColumns=13]="ThirteenColumns",n[n.SixteenColumns=16]="SixteenColumns"}(x.LayoutEnum||(x.LayoutEnum={}));var Qe=function(n){var f=n.layout,p=n.itemStyle,v=n.gridContainerStyle,M=n.selectedItem,P=n.gap,Y=P===void 0?Ke:P,j=n.selectBgColor,b=j===void 0?Ce:j,L=n.draggable,y=L===void 0?Ze:L,T=n.onSelect,s=n.onLayoutChange,A=n.renderChildNode,U=f,B=Q.default.useRef(null),z=Q.default.useState(M),W=z[0],d=z[1];f===x.LayoutEnum.ThirteenColumns&&(y=!1);var $=function(c){d(c),T&&T(c)},V=function(c){B.current=c.currentTarget,c.dataTransfer.dropEffect="move"},S=function(c){c.preventDefault()},I=function(c){var R=c.currentTarget,G=B.current;if(R!=null&&R!==G){var C=document.querySelector(".grid-wrapper"),k=document.createElement("div");C==null||C.appendChild(k),C==null||C.replaceChild(k,R),C==null||C.replaceChild(R,G),C==null||C.replaceChild(G,k)}},E=function(){var c;switch(f){case x.LayoutEnum.OneColumn:c=1;break;case x.LayoutEnum.FourColumns:c=2;break;case x.LayoutEnum.NineColumns:c=3;break;case x.LayoutEnum.ThirteenColumns:case x.LayoutEnum.SixteenColumns:c=4;break;default:c=1}return c},D=function(c){return f===x.LayoutEnum.ThirteenColumns&&c===0?_(_({},p),{gridArea:"1 / 1 / span 2 / span 2",width:"100%",height:"100%"}):p};return Q.default.useEffect(function(){s&&s(f)},[f]),g("div",_({className:"grid-wrapper",style:_({display:"grid",gridTemplateColumns:"repeat(".concat(E(),", 0fr)"),gap:Y},v)},{children:Array.from({length:U},function(c,R){return g("div",_({"data-id":R,onClick:function(){return $(R)},draggable:y,onDragStart:V,onDragOver:S,onDrop:I,style:_({backgroundColor:W===R?b:Ce,textAlign:"center",cursor:"pointer"},D(R))},{children:A(R)}),R)})}))};const N=`.panel{cursor:move;position:fixed;z-index:999;display:none;opacity:0}.panel .content{width:376px;height:210px;background:rgba(255,255,255,.2);backdrop-filter:blur(1.2px);border-radius:8px;position:relative;align-items:center;justify-content:space-evenly;display:flex}.panel .content .direction{width:168px;height:168px;border-radius:50%;background-color:#232324;display:flex;align-items:center;justify-content:center;position:relative;cursor:auto}.panel .content .direction:after{content:"";position:absolute;inset:0;border-radius:inherit;opacity:0;box-shadow:0 0 0 8px #fff;transition:.4s;z-index:-1}.panel .content .direction:active:after{box-shadow:none;opacity:.4;transition:0s}.panel .content .direction li{width:5px;height:5px;background:rgba(255,255,255,.5);border-radius:50%;list-style:none}.panel .content .direction li:nth-of-type(1){position:absolute;top:42px;left:42px}.panel .content .direction li:nth-of-type(2){position:absolute;bottom:42px;left:42px}.panel .content .direction li:nth-of-type(3){position:absolute;top:42px;right:42px}.panel .content .direction li:nth-of-type(4){position:absolute;bottom:42px;right:42px}.panel .content .direction svg:hover{cursor:pointer}.panel .content .direction svg:nth-of-type(1){position:absolute;top:22px;left:84px;transform:translate(-50%)}.panel .content .direction svg:nth-of-type(1):hover path{fill:#5583f5;transition:all .3s}.panel .content .direction svg:nth-of-type(2){position:absolute;top:84px;left:22px;transform:translateY(-50%)}.panel .content .direction svg:nth-of-type(2):hover path{fill:#5583f5;transition:all .3s}.panel .content .direction svg:nth-of-type(3){position:absolute;bottom:22px;left:84px;transform:translate(-50%)}.panel .content .direction svg:nth-of-type(3):hover path{fill:#5583f5;transition:all .3s}.panel .content .direction svg:nth-of-type(4){position:absolute;top:84px;right:22px;transform:translateY(-50%)}.panel .content .direction svg:nth-of-type(4):hover path{fill:#5583f5;transition:all .3s}.panel .content .direction .middle{width:56px;height:56px;background:#ffffff;opacity:.2;box-shadow:0 4px 4px rgba(0,0,0,.25);border-radius:50%}.panel .content .zoom{width:140px;height:50px;padding:0 17px;background:#232324;border:1px solid rgba(255,255,255,.12);border-radius:64px;display:flex;align-items:center;justify-content:space-between;cursor:auto}.panel .content .zoom .dec{width:22px;height:22px;border-radius:50%;border:2px solid #656566;position:relative;transition:all .1s}.panel .content .zoom .dec:hover{cursor:pointer;border-color:#5583f5}.panel .content .zoom .dec:before{content:"";display:inline-block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:12px;height:2px;background-color:#656566;border-radius:4px;transition:all .1s}.panel .content .zoom .dec:after{content:"";position:absolute;inset:0;border-radius:inherit;opacity:0;box-shadow:0 0 0 8px #fff;transition:.4s}.panel .content .zoom .dec:active:after{box-shadow:none;opacity:.4;transition:0s}.panel .content .zoom .inc{width:22px;height:22px;border-radius:50%;border:2px solid #656566;position:relative;display:flex;align-items:center;justify-content:center}.panel .content .zoom .inc:hover{cursor:pointer;border-color:#5583f5}.panel .content .zoom .inc:after{content:"";position:absolute;inset:0;border-radius:inherit;opacity:0;box-shadow:0 0 0 8px #fff;transition:.4s}.panel .content .zoom .inc:active:after{box-shadow:none;opacity:.4;transition:0s}.panel .content .zoom .inc .inner:before{content:"";display:inline-block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:12px;height:2px;background-color:#656566;border-radius:4px}.panel .content .zoom .inc .inner:after{content:"";display:inline-block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) rotate(90deg);width:12px;height:2px;background-color:#656566;border-radius:4px}.panel .content .cancel{position:absolute;width:20px;height:20px;top:17px;right:17px}.panel .content .cancel:hover{cursor:pointer;border-radius:4px;background-color:rgba(0,0,0,.06);transition:background-color .4s}.panel .content .cancel:before{content:"";display:block;width:2px;height:20px;background:#c4c4c4;border-radius:2px;position:relative;left:9px;transform:rotate(45deg)}.panel .content .cancel:after{content:"";display:block;width:2px;height:20px;background:#c4c4c4;border-radius:2px;position:relative;left:9px;top:-20px;transform:rotate(-45deg)}.open{display:block;opacity:1;transition:opacity .4s}
`;var H;(function(n){n.up="UP",n.rightUp="RIGHT_UP",n.right="RIGHT",n.rightDown="RIGHT_DOWN",n.down="DOWN",n.leftDown="LEFT_DOWN",n.left="LEFT",n.leftUp="LEFT_UP"})(H||(H={}));var ae;(function(n){n[n.dec=0]="dec",n[n.inc=1]="inc"})(ae||(ae={}));var er=function(n){var f=n.open,p=n.onCancel,v=p===void 0?function(){}:p,M=n.onStart,P=M===void 0?function(){}:M,Y=n.onEnd,j=Y===void 0?function(){}:Y,b=n.onZoom,L=b===void 0?function(){}:b,y=n.initPosition,T=y===void 0?{}:y,s=n.dropAreaRef,A=ee.useRef(!1),U=ee.useRef(),B=ee.useRef({initialX:0,initialY:0}),z=ee.useRef(!1);ee.useEffect(function(){if(!!(s!=null&&s.current)){var S=function(E){E.preventDefault(),E.currentTarget===s.current?E.dataTransfer.dropEffect="move":E.dataTransfer.dropEffect="none"},I=function(E){if(E.preventDefault(),!!z.current){z.current=!1;var D=U.current,c=B.current,R=c.initialX,G=c.initialY;D.style.left=E.clientX-R+"px",D.style.top=E.clientY-G+"px",D&&(D.style.right="none",D.style.bottom="none")}};return s.current.addEventListener("dragover",S),s.current.addEventListener("drop",I),function(){var E,D;(E=s==null?void 0:s.current)===null||E===void 0||E.removeEventListener("dragover",S),(D=s==null?void 0:s.current)===null||D===void 0||D.removeEventListener("drop",I)}}},[s==null?void 0:s.current]);var W=function(S){S.stopPropagation();var I=U.current;z.current=!0,B.current={initialX:S.clientX-I.offsetLeft,initialY:S.clientY-I.offsetTop}},d=function(S){A.current=!0,P(S)},$=function(){A.current&&(A.current=!1,j())},V=function(){A.current&&(A.current=!1,j())};return g("div",_({style:_({},T),className:"".concat(N.panel," ").concat(f?N.open:""),ref:U,draggable:!0,onDragStart:W,onDoubleClick:function(S){return S.stopPropagation()}},{children:de("div",_({className:N.content},{children:[de("div",_({className:N.direction},{children:[g("svg",_({width:"17",height:"10",viewBox:"0 0 17 10",onMouseDown:function(){return d(H.up)},onMouseUp:$,onMouseLeave:V},{children:g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.30394 0.693722L16.3239 7.56631C16.8147 8.0468 16.8147 8.82583 16.3239 9.30632C16.0882 9.53706 15.7686 9.66669 15.4353 9.66669H1.39531C0.701219 9.66669 0.13855 9.11583 0.13855 8.43632C0.13855 8.11 0.270958 7.79705 0.506645 7.56631L7.52662 0.693722C8.01741 0.213232 8.81315 0.213232 9.30394 0.693722Z",fill:"white",fillOpacity:"0.9"})})),g("svg",_({width:"11",height:"18",viewBox:"0 0 11 18",onMouseDown:function(){return d(H.left)},onMouseUp:$,onMouseLeave:V},{children:g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.296 8.12312L8.26121 1.19649C8.74818 0.712227 9.5377 0.712227 10.0247 1.19649C10.2585 1.42905 10.3899 1.74446 10.3899 2.07334L10.3899 15.9266C10.3899 16.6114 9.83161 17.1666 9.14294 17.1666C8.81223 17.1666 8.49506 17.036 8.26121 16.8034L1.296 9.8768C0.809032 9.39254 0.809032 8.60738 1.296 8.12312Z",fill:"white"})})),g("svg",_({width:"17",height:"10",viewBox:"0 0 17 10",onMouseDown:function(){return d(H.down)},onMouseUp:$,onMouseLeave:V},{children:g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.30394 9.30634L16.3239 2.43375C16.8147 1.95326 16.8147 1.17423 16.3239 0.693741C16.0882 0.463002 15.7686 0.333374 15.4353 0.333374H1.39531C0.701219 0.333374 0.13855 0.88423 0.13855 1.56375C0.13855 1.89006 0.270958 2.20301 0.506645 2.43375L7.52662 9.30634C8.01741 9.78683 8.81315 9.78683 9.30394 9.30634Z",fill:"white",fillOpacity:"0.9"})})),g("svg",_({width:"10",height:"18",viewBox:"0 0 10 18",onMouseDown:function(){return d(H.right)},onMouseUp:$,onMouseLeave:V},{children:g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.53396 9.87676L2.56874 16.8034C2.08178 17.2877 1.29225 17.2877 0.805287 16.8034C0.571438 16.5708 0.440063 16.2554 0.440063 15.9265L0.440063 2.0733C0.440063 1.38844 0.998343 0.833252 1.68702 0.833252C2.01773 0.833252 2.3349 0.963899 2.56875 1.19645L9.53396 8.12308C10.0209 8.60734 10.0209 9.3925 9.53396 9.87676Z",fill:"white",fillOpacity:"0.9"})})),g("li",{}),g("li",{}),g("li",{}),g("li",{}),g("div",{className:N.middle})]})),de("div",_({className:N.zoom},{children:[g("div",{className:N.dec,onClick:function(){return L(ae.dec)}}),g("div",_({className:N.inc,onClick:function(){return L(ae.inc)}},{children:g("span",{className:N.inner})}))]})),g("div",{className:N.cancel,onClick:v})]}))}))};x.Grid=Qe,x.Ptz=er,Object.defineProperties(x,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
